<template>
  <div class="table-toolbar">
    <!-- <a-space>
      <a-radio-group v-model:value="query.review">
        <a-radio-button value="all">全部</a-radio-button>
        <a-radio-button value="reviewed">已审阅</a-radio-button>
        <a-radio-button value="not-review">未审阅</a-radio-button>
      </a-radio-group>
    </a-space> -->
    <a-space>
      <refresh />
      <lineheight style="margin: 0 6px" />
      <column />
    </a-space>
  </div>
</template>
<script setup>
import refresh from './table-toolbar-refresh.vue'
import lineheight from './table-toolbar-lineheight.vue'
import column from './table-toolbar-column.vue'
import { ref, watch } from 'vue'
import {
  useQuery,
  useLoading,
  useDataSourceManager,
} from './provide-context.js'
let { update } = useDataSourceManager()
let query = useQuery()
let loading = useLoading()

watch(
  () => query.value.review,
  review => {
    console.log(query.value.review)
    query.value.current = 1
    if (loading.value) return
    update()
  },
)
</script>
<style lang="less" scoped>
.table-toolbar {
  display: flex;
  // justify-content: space-between;
  justify-content: flex-end;
  margin-bottom: 5px;
}
</style>
